<template>
    <div>
        <h1>添加分类页面</h1>
        分类名称:<input type="text" v-model="name">
        <button @click="add">添加</button>
        <button @click="gogo">返回展示页面</button>
    </div>
</template>

<script>
    export default {
        data(){
            return{
                name:""
            }
        },
        methods:{
            add(){
                this.$axios.post('cateM/',{"name":this.name}).then(res=>{
                    if(res.data.code==200){
                        console.log(res.data)
                        alert('添加成功')
                    }
                })
            },
            gogo(){
                this.$router.go(-1)
            }
        },
        mounted(){}
    }
</script>

<style scoped>

</style>
 